﻿<phone:PhoneApplicationPage 
    x:Class="BitcoinMarket.CurrencyDetailPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:BitcoinMarket"
    xmlns:chart="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Chart"
    xmlns:chartEngine="clr-namespace:Telerik.Charting;assembly=Telerik.Windows.Controls.Chart"
    xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
    d:DataContext="{d:DesignData SampleData/CurrecyDetailViewModelSampleData.xaml}"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True" 
    xmlns:telerikPrimitives="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Primitives"
    xmlns:telerikDataVisualization="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.DataVisualization"
    BorderThickness="0" Padding="0" OrientationChanged="PhoneApplicationPage_OrientationChanged" Loaded="PhoneApplicationPage_Loaded">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="White">
        <controls:Pivot Style="{StaticResource PivotStyle1}" Title="{Binding Path=LocalizedResources.AppTitleCapital, Source={StaticResource LocalizedStrings}}">
            <!--Pivot item one-->
            <controls:PivotItem Header="{Binding Path=LocalizedResources.CurrentValues, Source={StaticResource LocalizedStrings}}">
                <Grid x:Name="LayoutCurrentValues" Margin="0,-15,0,0" Background="Transparent">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>

                    <!--TitlePanel contains the name of the application and page title-->
                    <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="0,0,0,20">
                        <TextBlock x:Name="PageTitle" Foreground="#FF4D4D4D" Text="{Binding CurrencyName}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextExtraLargeStyle}"/>

                        <Grid x:Name="TitlePanelGrid" Margin="0,0,0,0">
                            <Grid.RowDefinitions>
                                <RowDefinition />
                                <RowDefinition />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="150"/>
                                <ColumnDefinition Width="120"/>
                                <ColumnDefinition Width="90"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>

                            <TextBlock Foreground="#FF4D4D4D" Grid.ColumnSpan="4" Grid.Row="0" Text="{Binding Path=LocalizedResources.MarketName, Source={StaticResource LocalizedStrings}}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}" Width="Auto" />
                            <TextBlock Foreground="#AA4D4D4D" Grid.Column="0" Grid.Row="1" Text="{Binding Path=LocalizedResources.LatestTrade, Source={StaticResource LocalizedStrings}}" TextWrapping="NoWrap" Style="{StaticResource PhoneTextSmallStyle}" Height="Auto" FontStyle="Normal" />
                            <TextBlock Foreground="#AA4D4D4D" Grid.Column="1" Grid.Row="1" Text="{Binding Path=LocalizedResources.LatestPrice, Source={StaticResource LocalizedStrings}}" TextWrapping="NoWrap" Style="{StaticResource PhoneTextSmallStyle}" Height="Auto" FontStyle="Normal" />
                            <TextBlock Foreground="#AA4D4D4D" Grid.Column="2" Grid.Row="1" Text="{Binding Path=LocalizedResources.AveragePrice, Source={StaticResource LocalizedStrings}}" TextWrapping="NoWrap" Style="{StaticResource PhoneTextSmallStyle}" Height="Auto" FontStyle="Normal" />
                            <TextBlock Foreground="#AA4D4D4D" Grid.Column="3" Grid.Row="1" Text="{Binding Path=LocalizedResources.Volume, Source={StaticResource LocalizedStrings}}" TextWrapping="NoWrap" Style="{StaticResource PhoneTextSmallStyle}" Height="Auto" FontStyle="Normal" />
                            <!--TextBlock Grid.Column="4" Grid.Row="1" Text="{Binding ItemAsk}" TextWrapping="NoWrap" Style="{StaticResource PhoneTextSmallStyle}" Height="Auto" FontStyle="Normal" />
                                        <TextBlock Grid.Column="5" Grid.Row="1" Text="{Binding ItemClose}" TextWrapping="NoWrap" Style="{StaticResource PhoneTextSmallStyle}" Height="Auto" FontStyle="Normal" />
                                        <TextBlock Grid.Column="6" Grid.Row="1" Text="{Binding ItemAvg}" TextWrapping="NoWrap" Style="{StaticResource PhoneTextSmallStyle}" Height="Auto" FontStyle="Normal" />
                                        <TextBlock Grid.Column="7" Grid.Row="1" Text="{Binding ItemLow}" TextWrapping="NoWrap" Style="{StaticResource PhoneTextSmallStyle}" Height="Auto" FontStyle="Normal" /-->
                        </Grid>
                    </StackPanel>

                    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="0,0,12,0">

                        <!--ContentPanel - place additional content here-->

                        <ListBox Margin="0,-12,-12,0" ItemsSource="{Binding Items}" Style="{StaticResource ListBoxStyle1}">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Width="Auto" HorizontalAlignment="Left">
                                        <Grid x:Name="DataPanel" Margin="0,0,0,0">
                                            <Grid.RowDefinitions>
                                                <RowDefinition />
                                                <RowDefinition />
                                            </Grid.RowDefinitions>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="150"/>
                                                <ColumnDefinition Width="110"/>
                                                <ColumnDefinition Width="90"/>

                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>

                                            <TextBlock Foreground="#FF4D4D4D" Grid.ColumnSpan="4" Grid.Row="0" Text="{Binding ItemTitle}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}" Width="Auto" />
                                            <TextBlock Foreground="#AA4D4D4D" Grid.Column="0" Grid.Row="1" Text="{Binding ItemLTrade}" TextWrapping="NoWrap" Style="{StaticResource PhoneTextSmallStyle}" Height="Auto" FontStyle="Normal" />
                                            <TextBlock Foreground="#AA4D4D4D" Grid.Column="1" Grid.Row="1" Text="{Binding ItemClose}" TextWrapping="NoWrap" Style="{StaticResource PhoneTextSmallStyle}" Height="Auto" FontStyle="Normal" />
                                            <TextBlock Foreground="#AA4D4D4D" Grid.Column="2" Grid.Row="1" Text="{Binding ItemAvg}" TextWrapping="NoWrap" Style="{StaticResource PhoneTextSmallStyle}" Height="Auto" FontStyle="Normal" />
                                            <TextBlock Foreground="#AA4D4D4D" Grid.Column="3" Grid.Row="1" Text="{Binding ItemVolume}" TextWrapping="NoWrap" Style="{StaticResource PhoneTextSmallStyle}" Height="Auto" FontStyle="Normal" />
                                            <!--TextBlock Grid.Column="4" Grid.Row="1" Text="{Binding ItemAsk}" TextWrapping="NoWrap" Style="{StaticResource PhoneTextSmallStyle}" Height="Auto" FontStyle="Normal" />
                                        <TextBlock Grid.Column="5" Grid.Row="1" Text="{Binding ItemClose}" TextWrapping="NoWrap" Style="{StaticResource PhoneTextSmallStyle}" Height="Auto" FontStyle="Normal" />
                                        <TextBlock Grid.Column="6" Grid.Row="1" Text="{Binding ItemAvg}" TextWrapping="NoWrap" Style="{StaticResource PhoneTextSmallStyle}" Height="Auto" FontStyle="Normal" />
                                        <TextBlock Grid.Column="7" Grid.Row="1" Text="{Binding ItemLow}" TextWrapping="NoWrap" Style="{StaticResource PhoneTextSmallStyle}" Height="Auto" FontStyle="Normal" /-->
                                        </Grid>
                                    </StackPanel>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>

                    </Grid>
                </Grid>


                <!--Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
                    <TextBlock Text="{Binding LineThree}" TextWrapping="Wrap" Style="{StaticResource PhoneTextSubtleStyle}" Height="Auto" />
                    <ListBox Margin="0,0,-12,0" ItemsSource="{Binding Items}">

                        <StackPanel Width="432" HorizontalAlignment="Left">
                            <Grid x:Name="DataPanel" Margin="0,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition />
                                    <RowDefinition />
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="90"/>
                                    <ColumnDefinition Width="90"/>
                                    <ColumnDefinition Width="90"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.ColumnSpan="3" Grid.Row="0" Text="Binding ItemTitle" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}" Width="Auto" />
                                <TextBlock  Grid.Column="0" Grid.Row="1" Text="ItemHigh" TextWrapping="NoWrap" Style="{StaticResource PhoneTextSmallStyle}" Height="Auto" FontStyle="Normal" />
                                <TextBlock  Grid.Column="1" Grid.Row="1" Text="ItemLTrade" TextWrapping="NoWrap" Style="{StaticResource PhoneTextSmallStyle}" Height="Auto" FontStyle="Normal" />
                                <TextBlock  Grid.Column="2" Grid.Row="1" Text="ItemBid" TextWrapping="NoWrap" Style="{StaticResource PhoneTextSmallStyle}" Height="Auto" FontStyle="Normal" />
                            </Grid>
                        </StackPanel>

                    </ListBox>
                </Grid-->
            </controls:PivotItem>

            <!--Pivot item two-->
            <controls:PivotItem Foreground="#FF4D4D4D" Header="{Binding Path=LocalizedResources.History, Source={StaticResource LocalizedStrings}}">
                <Grid x:Name="LayoutCurrentValues2" Margin="0,-15,0,0" Background="Transparent">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>

                    <!--TitlePanel contains the name of the application and page title-->
                    <StackPanel x:Name="TitlePanel2" Grid.Row="0" Margin="0,0,0,20">
                        <Grid Margin="0,-5,0,0" Background="Transparent">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Foreground="#FF4D4D4D" Grid.Column="0" x:Name="PageTitle2" Text="{Binding CurrencyName}" Margin="9,0,0,0" Style="{StaticResource PhoneTextExtraLargeStyle}"/>
                            <telerikInput:RadListPicker
                                Grid.Column="1" 
                                x:Name="marketsPicker" 
                                Margin="15,0,0,0"
                                PopupHeader="{Binding Path=LocalizedResources.Markets, Source={StaticResource LocalizedStrings}}"
                                ActionButtonVisibility="Visible"
                                SelectionMode="Multiple"
                                OkButtonIconUri="/Images/appbar.check.rest.png"
                                CancelButtonIconUri="/Images/appbar.cancel.rest.png"
                                SelectionChanged="marketsPicker_SelectionChanged"
                                Background="#FFE2E2E2"
                                BorderBrush="#FFE2E2E2">
                                <telerikInput:RadListPicker.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <Rectangle Fill="{Binding Color}" Width="40" Height="40"/>
                                            <TextBlock Text="{Binding MarketName}" Margin="20 0 0 0"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </telerikInput:RadListPicker.ItemTemplate>
                            </telerikInput:RadListPicker>
                        </Grid>
                    </StackPanel>

                    <Grid x:Name="ChartPanel" Grid.Row="1" Margin="0,-10,12,0">

                        <chart:RadCartesianChart x:Name="TradesChart" BorderThickness="0" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" >
                            <chart:RadCartesianChart.Grid>
                                <chart:CartesianChartGrid MajorLinesVisibility="XY">
                                    <chart:CartesianChartGrid.MajorXLineStyle>
                                        <Style TargetType="Line">
                                            <Setter Property="Shape.Stroke" Value="#804D4D4D" />
                                        </Style>
                                    </chart:CartesianChartGrid.MajorXLineStyle>
                                    <chart:CartesianChartGrid.MajorYLineStyle>
                                        <Style TargetType="Line">
                                            <Setter Property="Shape.Stroke" Value="#804D4D4D" />
                                        </Style>
                                    </chart:CartesianChartGrid.MajorYLineStyle>
                                </chart:CartesianChartGrid>
                            </chart:RadCartesianChart.Grid>
                            <chart:RadCartesianChart.Behaviors>
                                <chart:ChartPanAndZoomBehavior ZoomMode="Horizontal" PanMode="Horizontal" HandleDoubleTap="False"/>
                            </chart:RadCartesianChart.Behaviors>
                            <chart:RadCartesianChart.HorizontalAxis>
                                <chart:DateTimeContinuousAxis LabelFitMode="Rotate" LabelInterval="3" x:Name="TradesHorizontalAxis" Foreground="#FF4D4D4D" FontSize="14" LineStroke="#FF4D4D4D" LineThickness="2"/>
                                <!--chart:DateTimeContinuousAxis x:Name="TradesHorizontalAxis" ShowLabels="True" LabelFitMode="Rotate" Foreground="#FF4D4D4D" FontSize="14" LineStroke="#FF4D4D4D" LineThickness="2"/-->
                                <!--chart:DateTimeCategoricalAxis x:Name="TradesHorizontalAxis" ShowLabels="True" LabelFitMode="Rotate" Foreground="#FF4D4D4D" FontSize="14" LineStroke="#FF4D4D4D" LineThickness="2"
                                   DateTimeComponent="Hour" LastLabelVisibility="Visible" MajorTickInterval="20" PlotMode="OnTicks" /-->
                            </chart:RadCartesianChart.HorizontalAxis>
                            <chart:RadCartesianChart.VerticalAxis>
                                <chart:LinearAxis RangeExtendDirection="Both" Foreground="#FF4D4D4D" FontSize="14" LineStroke="#FF4D4D4D" LineThickness="2" />
                            </chart:RadCartesianChart.VerticalAxis>


                            <!--chart:LineSeries ItemsSource="{Binding}">
                                <chart:LineSeries.CategoryBinding>
                                    <chart:PropertyNameDataPointBinding PropertyName="Date">
                                    </chart:PropertyNameDataPointBinding>
                                </chart:LineSeries.CategoryBinding>
                                <chart:LineSeries.ValueBinding>
                                    <chart:PropertyNameDataPointBinding PropertyName="Value">
                                    </chart:PropertyNameDataPointBinding>
                                </chart:LineSeries.ValueBinding>
                            </chart:LineSeries-->
                            
                        </chart:RadCartesianChart>
                        <ProgressBar Foreground="#F7931A" Grid.Row="1"  Height="4" HorizontalAlignment="Left" Margin="0,30,0,0" Name="TradesChartProgressBar" VerticalAlignment="Center" Width="460" IsIndeterminate="True" />
                    </Grid>
                </Grid>

            </controls:PivotItem>
        </controls:Pivot>
    </Grid>    
</phone:PhoneApplicationPage>
